<style>
    .radio {
        margin-top: 5px;
        margin-left: 15px;
        float: left;
    }

    ul, ol {
        list-style: none outside none;
    }

    em.zt {
        font-size: 0;
        line-height: 0;
        width: 0;
        height: 0;
        display: inline-block;
        padding: 0;
        border: 4px solid;
        border-color: #333 transparent transparent transparent;
        border-style: solid dashed dashed dashed;
    }

    .ks-stdmod-body label {
        display: inline-block;
    }

    #calroot {
        z-index: 1000;
    }
</style>
<div class="form-horizontal js-ajax-form">
    <div class="row-fluid">
        <table class="table table-bordered">
            <input type="text" name="id" value="{$card.id}" class="hide"/>
            <input type="text" name="huodong_extend_id" value="{$card_huodong.id}" class="hide"/>
            <input type="text" name="card_detail_id" value="{$card_detail.id}" class="hide"/>
            <tr>
                <th class="span4">名称</th>
                <td class="span4">
                    {$card.card_name}
                </td>
                <th class="span4">投放类型</th>
                <td class="span4">
                    <input type="hidden" name="card_type" value="{$card.card_type}"/>
                        <span class="switch_list cc">
                            <foreach name="cardTypeList" item="vo">
                                    <if condition="$card['card_type'] eq $vo['id']">
                                        <span>{$vo.name}</span>
                                    </if>
                            </foreach>
                        </span>
                </td>
            </tr>
            <!-- <tr>
                 <th id="prizes_grade">奖品级别 <br> (选填)</th>
                 <td>
                     <select name="prizes_grade">
                         <option value="">请选择</option>
                         <foreach name="prizesGradeList" item="vo">
                             <option value="{$vo.id}"
                             <if condition="$card_huodong['prizes_grade'] eq $vo['id']">selected</if>
                             >{$vo.name}</option>
                         </foreach>
                     </select>
                 </td>
             </tr>-->
            <tr>
                <th id="card_count_th">卡券总量/个</th>
                <td>
                    {$card.card_count}
                </td>
                <th>核销密码</th>
                <td>
                    {$card.password}
                </td>
            </tr>
            <tr id="redinput" style="display:none">
                <th>中奖金额/分</th>
                <td>
                    {$card.min_money} ~
                    <br>
                    {$card.max_money}
                </td>
                <th>中奖限制</th>
                <td>
                    {$card.day_count_limit_by_user}次/人/天
                    {$card.count_limit_by_user}次/人/总计
                    {$card.card_count_day}次/总计/天
                </td>
            </tr>
            <tr>
                <th>开始日期</th>
                <td>
                    {$card.start_at}
                </td>
                <th>结束日期</th>
                <td>
                    {$card.end_at}
                </td>
            </tr>
            <tr data-group="n1">
                <th>投放筛选</th>
                <td class="cell-area">
                    {$card.areaNameList}
                </td>
                <th>选择群组<br>(选填)
                </td>
                <td>
                    <div id="groupbox"
                    <if condition="!count($card_groups)"> style="display:none"</if>
                    >
                    <foreach name="groups" item="vo">
                        <label style="float: left; margin-right:10px;">
                            <foreach name="card_groups" item="egroup">
                                <if condition="$vo['id'] eq $egroup['area_id']">
                                    <span>{$vo.name}</span>
                                </if>
                            </foreach>
                        </label>
                    </foreach>
                    <div></div>
                    <foreach name="customGroups" item="vo">
                        <label style="float: left; margin-right:10px;">
                            <foreach name="card_customGroups" item="egroup">
                                <if condition="$vo['id'] eq $egroup['area_id']">
                                    <span>{$vo.area_name}</span>
                                </if>
                            </foreach>
                        </label>
                    </foreach>
            </div>
        </td>
        </tr>
        <!--<tr>
            <th>库存预警</th>
            <td>
                <input type="text" name="yj_num"style="width: 78px;" maxlength="4" placeholder="预警数/金额" onKeypress="if (event.keyCode < 45 || event.keyCode > 57) event.returnValue = false;" value="{$card.yj_num}">
                <input type="text" name="yj_phone" style="width: 110px;" maxlength="11" placeholder="通知手机号" onKeypress="if (event.keyCode < 45 || event.keyCode > 57) event.returnValue = false;" value="{$card.yj_phone}">库存预警最长4位数字、手机号11位数字
            </td>
        </tr>-->
        <tr>
            <th>图片链接<br>(选填)</th>
            <td>
                {$card.card_url}
            </td>
            <th>中奖词</th>
            <td>
                {$card.congratulations}
            </td>
            </tr>
        <tr>
            <th>简介</th>
            <td>
                {$card.card_intro}
            </td>
            <th>卡券id</th>
            <td>
            {$card.external_cardid}
            </td>
        </tr>
            <tr>
            <th>有效期<br>(选填)</th>
            <td>
                "开始日期":"{$card_detail.card_sdate}"
                "结束日期":"{$card_detail.card_edate}"
            </td>
            <th>可用时段<br>(选填)</th>
            <td>
                <div class="row">
                    <div class="span12 offset1">
                        <label class="radio">
                            <input type="radio" name="open_time_type" id="optionsRadios1" value="1"
                            <if condition="$card_detail['open_time_type'] eq 1">checked</if>
                            >
                            全部时段
                        </label>
                        <label class="radio">
                            <input type="radio" name="open_time_type" id="optionsRadios2" value="2"
                            <if condition="$card_detail['open_time_type'] eq 2">checked</if>
                            >
                            部分时段
                        </label>
                    </div>
                    <div class="span12 offset1 open_time_area" style="display:none">
                        <label class="checkbox inline">
                            日期:
                        </label>
                        <label class="checkbox inline">
                            <input type="checkbox" id="inlineCheckbox1" name="open_time_day[]" value="1"
                                   style="margin-left: 0px"
                            <if condition="in_array(1, $card_detail['open_time_day'])">checked</if>
                            > 星期一
                        </label>
                        <label class="checkbox inline">
                            <input type="checkbox" id="inlineCheckbox2" name="open_time_day[]" value="2"
                                   style="margin-left: 0px"
                            <if condition="in_array(2, $card_detail['open_time_day'])">checked</if>
                            > 星期二
                        </label>
                        <label class="checkbox inline">
                            <input type="checkbox" id="inlineCheckbox3" name="open_time_day[]" value="3"
                                   style="margin-left: 0px"
                            <if condition="in_array(3, $card_detail['open_time_day'])">checked</if>
                            > 星期三
                        </label>
                        <label class="checkbox inline">
                            <input type="checkbox" id="inlineCheckbox4" name="open_time_day[]" value="4"
                                   style="margin-left: 0px"
                            <if condition="in_array(4, $card_detail['open_time_day'])">checked</if>
                            > 星期四
                        </label>
                        <label class="checkbox inline">
                            <input type="checkbox" id="inlineCheckbox5" name="open_time_day[]" value="5"
                                   style="margin-left: 0px"
                            <if condition="in_array(5, $card_detail['open_time_day'])">checked</if>
                            > 星期五
                        </label>
                        <label class="checkbox inline">
                            <input type="checkbox" id="inlineCheckbox6" name="open_time_day[]" value="6"
                                   style="margin-left: 0px"
                            <if condition="in_array(6, $card_detail['open_time_day'])">checked</if>
                            > 星期六
                        </label>
                        <label class="checkbox inline">
                            <input type="checkbox" id="inlineCheckbox7" name="open_time_day[]" value="0"
                                   style="margin-left: 0px"
                            <if condition="in_array(0, $card_detail['open_time_day'])">checked</if>
                            > 星期日
                        </label>
                    </div>
                    <div class="span12 offset1 open_time_area" style="display:none">
                        <label class="span1 checkbox inline">
                            时间:
                        </label>
                        <label class="span11 checkbox inline">
                            <div class="row">
                                <input type="text" id="inlineCheckbox1" name="open_time_start1" class="js-time"
                                       placeholder="开始时间" value="{$card_detail['open_time_period'][0]['start']}">~
                                <input type="text" id="inlineCheckbox1" name="open_time_end1" class="js-time"
                                       placeholder="结束日期" value="{$card_detail['open_time_period'][0]['end']}">
                            </div>
                            <div class="row" style="margin-top: 2px;">
                                <input type="text" id="inlineCheckbox1" name="open_time_start2" class="js-time"
                                       placeholder="开始时间" value="{$card_detail['open_time_period'][1]['start']}">~
                                <input type="text" id="inlineCheckbox1" name="open_time_end2" class="js-time"
                                       placeholder="结束日期" value="{$card_detail['open_time_period'][1]['end']}">
                            </div>
                        </label>
                        <span class="offset1 inline">时间区间可以填写一个也可以填写两个</span>
                    </div>
                </div>
            </td>
        </tr>
        <tr class='card_detail'>
            <th>使用须知<br>(选填)</th>
            <td colspan="3">
                <div>
                {$card_detail.user_notice}
                </div>
            </td>
        </tr>
        <tr>
            <th><b>活动图片</b></th>
            <td colspan="3">
                <if condition="$card['card_icon']">
                    <img src="{$urlimg}{$card.card_icon}" name="card_icon" style="width: 300px">
                    <input type="hidden" name="card_icon" value="{$card.card_icon}"/>
                </if>
            </td>
        </tr>
    </table>
</div>
<form class="form-horizontal" id="prev-from">
    <input type="text" name="id" value="{$card.id}" class="hide"/>
    <div class="control-group">
        <label class="control-label" for="reason">审核意见</label>
        <div class="controls">
            <textarea rows="3" cols="256" type="text" class="input-xxlarge" id="reason" name="reason" placeholder="审核不通过为必填项"></textarea>
        </div>
    </div>
</form>
<script src="//cdn.bootcss.com/jquery-validate/1.15.1/jquery.validate.min.js"></script>
<script type="text/javascript" src="__PUBLIC__/js/M97DatePicker/WdatePicker.js"></script>
